/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.pokemon.dao;

import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import com.pokemon.entities.Badge;

/**
 *
 * @author Branislav Paulis
 */
public interface BadgeDAO {
    
    /**
     * Method adds a badge into the database.
     * 
     * @param badge the badge to be added
     */
    void addBadge(Badge badge);
    
    /**
     * Method returns a badge from the database found according its id.
     * 
     * @param id the id of the badge to be found
     * @return the found badge, null if there is no such id in the database
     */
    Badge getBadge(Long id);
    
    /**
     * Method updates a badge in the database.
     * 
     * @param badge the badge to be updated
     */
    void updateBadge(Badge badge);
    
    /**
     * Method removes a badge from the database.
     * 
     * @param badge the badge to be removed
     */
    void removeBadge(Badge badge);
    
    /**
     * Method finds all the badges in the database and returns a list of them.
     * 
     * @return the list of badges, empty list if there is no badges in the database
     */
    List<Badge> getAllBadges();
    
    /**
     * Method sets entity manager factory.
     * 
     * @param entityManagerFactory
     */
    void setEntityManagerFactory(EntityManagerFactory entityManagerFactory);
    
    void setEm(EntityManager entityManager);
}
